package com.fp.m7.shared;

/**
 * Helper constants for validation. Contains regexps for validation.
 */
public interface ValidationConstants {

    public final static String PASSWORD_REGEX = "^.{6,100}$";
    public final static String USERNAME_REGEX = "^[a-zA-Z0-9_]{4,100}$";
    public final static String NICKNAME_REGEX = "^[a-zA-Z0-9_]{1,50}$";

    public final static String STATUS_REGEX = "^.{0,160}$";
    public final static String DESCRIPTION_REGEX = "(?s)^.{0,1000}$"; // (?s) == Pattern.DOTALL, dots allow line-breaks
    public final static String COMMENT_REGEX = "^.{1,160}$";

    /**
     * A set of commonly used field names.
     */
    public interface Fields {
        public final static String USERNAME = "USERNAME";
        public final static String NICKNAME = "NICKNAME";
        public final static String PASSWORD = "PASSWORD";
        public final static String NEW_PASSWORD = "NEW_PASSWORD";
        public final static String NEW_PASSWORD_REPEATED = "NEW_PASSWORD_REPEATED";
        public final static String STATUS = "STATUS";
        public final static String DESCRIPTION = "DESCRIPTION";
        public final static String COMMENT = "COMMENT";
        public final static String CAPTCHA = "CAPTCHA";
    }

    /**
     * A set of commonly used validation messages.
     */
    public interface Messages {
        public final static String INCORRECT = "INCORRECT";
        public final static String REGEX_FAIL = "REGEX_FAIL";
        public final static String NO_MATCH = "NO_MATCH";
        public final static String NOT_AVAILABLE = "NOT_AVAILABLE";
        public final static String UNKNOWN = "UNKNOWN";
        public final static String EXCEEDED_LENGTH = "EXCEEDED_LENGTH";
    }

}
